import java.util.*;


public class Solution3 {
    /**
     * 代码中的类名、方法名、参数名已经指定，请勿修改，直接返回方法规定的值即可
     *
     * 比较版本号
     * @param version1 string字符串 
     * @param version2 string字符串 
     * @return int整型
     */
    public int compare (String version1, String version2) {
        // write code here
        String[] s1 = version1.split("\\.");
        String[] s2 = version2.split("\\.");
        int len = s1.length;
        if(len > s2.length) {
            len = s2.length;
        }
        for(int i = 0;i<len;i++) {
            int i1 = Integer.valueOf(s1[i]);
            int i2 = Integer.valueOf(s2[i]);
            if(i1 > i2) {
                return 1;
            } else if(i1 < i2) {
                return -1;
            }
        }
        int k = len;
        while(k < s1.length) {
            int i = Integer.valueOf(s1[k++]);
            if(i != 0) {
                return 1;
            }
        }
        k = len;
        while(k < s2.length) {
            int i = Integer.valueOf(s2[k++]);
            if(i != 0) {
                return -1;
            }
        }
        return 0;
    }
}